#include<stdio.h>
int main(void)
{
    int year,year1,i;
    i=0;
    scanf("%d",&year);

    if(year<=2000||year>2100){
        printf("Invalid year!");
        goto out;
        
    } 
        else
            for(year1=2001;year1<=year;year1++){
                if((year1%4==0&&year1%100!=0)||year1%400==0){
                    printf("%d\n",year1);
                    i++;
                }    
            }
            if(i==0)
                printf("None");

            out:  return 0;
}